﻿using BCCommon;
using BCCommon.TMS.Transport;
using BCDto.Sim.Admin.Admin;
using BCDto.TMS.VehicleBusinessMapping;
using BCDto.TMS.VehicleCategoryReference;
using BCDto.TMS.VehicleType;
using BCDto.TMS.VehicleType.VehicleGroup;
using System.Collections.Generic;

namespace BCService.TMS.VehicleTypeService
{
    /// <summary>
    /// 车辆类型业务接口
    /// </summary>
    public interface IVehicleTypeService
    {
        /// <summary>
        /// 新增车型
        /// </summary>
        /// <param name="admin"></param>
        /// <param name="dto"></param>
        /// <returns>车辆类型id</returns>
        VehicleTypeDto Add(AdminDto admin, VehicleTypeRequestDto dto);

        /// <summary>
        /// 审核车辆新增
        /// </summary>
        /// <param name="dto"></param>
        /// <returns>vehicleCategoryReferenceId</returns>
        (int vehicleTypeId, int vehicleCategoryReferenceId) AuditVehicleInsertAsync(VehicleTypeRequestDto dto);

        ///  <summary>
        /// 修改
        ///  </summary>
        /// <param name="admin"></param>
        /// <param name="vehicleTypeId"></param>
        /// <param name="dto"></param>
        /// <returns></returns>
        VehicleTypeDto Update(AdminDto admin,int vehicleTypeId, VehicleTypeRequestDto dto);

        /// <summary>
        /// 修改车型启用状态
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <param name="vehicleTypeId">车辆类型id</param>
        /// <param name="auditStatusRequestDto">启用请求</param>
        /// <returns></returns>
        bool UpdateAuditStatus(AdminDto admin, int vehicleTypeId, AuditStatusRequestDto auditStatusRequestDto);

        /// <summary>
        /// 通过车辆id获取车辆信息
        /// </summary>
        /// <param name="vehicleTypeId"></param>
        /// <returns></returns>
        VehicleTypeDto GetById(int vehicleTypeId);

        /// <summary>
        /// 已存在车辆类型所有列表
        /// </summary>
        /// <returns></returns>
        List<VehicleTypeDto> VehicleNameList();

        /// <summary>
        /// 获取最大的车辆类型值
        /// </summary>
        /// <returns></returns>
        MaxVehicleTypeValueDto MaxVehicleTypeValue();

        /// <summary>
        /// 列表分页条件查询
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <param name="categoryReferenceIdStr">车辆分类对应Id</param>
        /// <param name="vehicleTypeId">车辆类型Id</param>
        /// <param name="vehicleTypeEnum">车辆所属类型（对应字典引用检索键）</param>
        /// <param name="maxStartWeight">最大开始载重</param>
        /// <param name="maxEndWeight">最大结束载重</param>
        /// <param name="maxStartStere">车辆最大起始载货立方</param>
        /// <param name="maxEndStere">车辆最大结束载货立方</param>
        /// <param name="enabled">是否启用</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">页面大小</param>
        /// <returns></returns>
        PageableList<VehicleTypeDto> PageWhereList(AdminDto admin, string categoryReferenceIdStr, int? vehicleTypeId, string vehicleTypeEnum, int? maxStartWeight, int? maxEndWeight, decimal? maxStartStere, decimal? maxEndStere, bool? enabled, int pageIndex, int pageSize);
        /// <summary>
        /// 获取车型列表
        /// </summary>
        /// <param name="length">长</param>
        /// <param name="width">宽</param>
        /// <param name="height">高</param>
        /// <returns></returns>
        IEnumerable<VehicleTypeDto> GetVehicleList(decimal length, decimal width, decimal height);

        #region 车型分类对应表

        /// <summary>
        /// 获取车型分类对应表
        /// </summary>
        /// <param name="vehicleTypeId">车型ID</param>
        /// <returns></returns>
        List<VehicleCategoryReferenceDto> GetCategoryReferenceList(int? vehicleTypeId);

        #endregion 车型分类对应表

        #region AppClient使用

        /// <summary>
        /// 获取车辆类型列表--所有
        /// </summary>
        /// <param name="provinceId">省份Id</param>
        /// <param name="communityId">城市Id</param>
        /// <param name="countyId">区县Id</param>
        /// <returns></returns>
        List<VehicleGroupDto> GetVehicleTypes(string provinceId, string communityId, string countyId);
        /// <summary>
        /// 获取车辆类型列表--所有--新
        /// </summary>
        /// <param name="provinceId">省份Id</param>
        /// <param name="communityId">城市Id</param>
        /// <param name="countyId">区县Id</param>
        /// <returns></returns>
        IEnumerable<VehicleTypeFreightDto> GetVehicleTypesQuery(string provinceId, string communityId, string countyId);

        #endregion AppClient使用

        /// <summary>
        /// 获取代理商启用车型
        /// </summary>
        /// <param name="agentRecordId">代理商ID</param>
        /// <param name="countyCode">区县编码</param>
        /// <param name="transportBusinessType">运输业务类型</param>
        /// <returns></returns>
        IEnumerable<VehicleBusinessMappingViewDto> GetList(long? agentRecordId, string countyCode, TransportBusinessType? transportBusinessType);
    }
}